//: enumerated/RoShamBo3.java
// Using constant-specific methods.
package base.enumtest.fenfa;

public enum RoShamBo3 implements Competitor<RoShamBo3> {
	PAPER{
		public Outcome compete(RoShamBo3 competitor){
			switch(competitor){
				default:
				case PAPER: return Outcome.DRAWN;
				case SCISSORS: return Outcome.LOSE;
				case ROCK: return Outcome.WIN;
			}
		}
	},
	SCISSORS{
		public Outcome compete(RoShamBo3 competitor){
			switch(competitor){
			default:
			case PAPER:return Outcome.WIN;
			case SCISSORS: return Outcome.DRAWN;
			case ROCK :return Outcome.LOSE;
			}
		}
	},
	ROCK{
		public Outcome compete(RoShamBo3 competitor) {
			switch (competitor) {
			default:
			case PAPER:
				return Outcome.LOSE;
			case SCISSORS:
				return Outcome.WIN;
			case ROCK:
				return Outcome.DRAWN;
			}
		}
	};

	public abstract Outcome compete(RoShamBo3 competitor);
	
	public static void main(String[] args) {
		RoShamBo.play(RoShamBo3.class, 20);
	}
	
}
